package com.woniuxy.boot.common.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Document(indexName = "esorder")
public class EsOrder implements Serializable {
    @Id
    private Long id;
    /**
     * 编号
     */
    @Field(type = FieldType.Text , value = "no")
    private String no;//编号
    /**
     * 用户id
     */
    @Field(type = FieldType.Long , value = "userId")
    private Long userId;//买家id
    /**
     * 总价格
     */
    @Field(type = FieldType.Text , value = "totalMoney")
    private BigDecimal totalMoney;//总价格
    /**
     * 支付时间
     */
    @Field(type = FieldType.Date , value = "payTime" ,format = {},pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime payTime;//支付时间
    /**
     * 生效日期
     */
    @Field(type = FieldType.Date , value = "guaranteeDate",format = {},pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime guaranteeDate;
    /**
     * 支付状态
     */
    @Field(type = FieldType.Text , value = "payStatus")
    private String payStatus;//支付状态
    /**
     * 车辆id
     */
    @Field(type = FieldType.Long , value = "carId")
    private Long carId;//投保车辆
    /**
     * 保单id
     */
    @Field(type = FieldType.Long , value = "policyId")
    private Long policyId;//保单id
    /**
     * 车牌号
     */
    @Field(type = FieldType.Text, value = "carNumber")
    private String carNumber;
    /**
     * 发动机号
     */
    @Field(type = FieldType.Text , value = "frameNumber")
    private String frameNumber;
    /**
     * 品牌型号
     */
    @Field(type = FieldType.Text , value = "brand")
    private  String brand;
    /**
     * 车主名称
     */
    @Field(type = FieldType.Text , value = "name")
    private  String name;
    /**
     * 手机号
     */
    @Field(type = FieldType.Text , value = "phone")
    private  String phone;
}
